﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<ChungNhanSinhVien.Entities.LoaiChungNhan>>" %>
<%using (Html.BeginForm())
  {
      
%>
<table cellspacing="0" cellpadding="2" style="width: 100%; border: medium outset" align="center">
    <tr>
        <td colspan="3" style="color: #588437; font-weight: bold">
            <h3>
                Danh sách loại chứng nhận</h3>
        </td>
        <td align="right">
            <%:Html.ActionLink("Tạo mới", "TaoMoiLoaiCN", "Ad_ChungNhan")%>
        </td>
    </tr>
    <tr style="border: medium outset; background-color: #588437; font-weight: bold; color: White"
        align="center">
        <td style="width: 10%; border: medium outset;">
            Mã loại
        </td>
        <td style="width: 30%; border: medium outset;">
            Tên loại
        </td>
        <td style="border: medium outset;">
            Mô tả
        </td>
        <td style="width: 10%; border: medium outset;">
            Thao tác
        </td>
    </tr>
    <%if (Model != null)
          foreach (var item in Model)
          {
              if (Model.ToList().IndexOf(item) % 2 == 1)
              {
    %>
    <tr style="background-color:#9BBB59">
        <td align="center" style="border: medium outset;">
            <%:item.ID%>
        </td>
        <td style="border: medium outset;">
            <%:Html.ActionLink(item.TenLoaiChungNhan, "XemChungNhanTheoLoaiCN", new { id = item.ID }, new { style = "color: #000000; font-weight:bold; text-decoration:none" })%>
        </td>
        <td style="border: medium outset;">
            <%:item.MoTa%>
        </td>
        <td style="border: medium outset;"align=center>
            <%:Html.ActionLink("Sửa", "SuaLoaiCN", "Ad_ChungNhan", new { id = item.ID }, new { @class = "al-edit", @title = "Sửa" })%>
            <%:Html.ActionLink("Xóa", "XoaLoaiCN", "Ad_ChungNhan", new { id = item.ID }, new { @class = "al-delete", @title = "Xóa" })%>
        </td>
    </tr>
    <%
}
              else
              {
    %>
    <tr style="background-color:#E8EBA4">
        <td align="center" style="border: medium outset;">
            <%:item.ID%>
        </td>
        <td style="border: medium outset;">
            <%:Html.ActionLink(item.TenLoaiChungNhan, "XemChungNhanTheoLoaiCN", new { id = item.ID }, new { style = "color: #000000; font-weight:bold; text-decoration:none" })%>
        </td>
        <td style="border: medium outset;">
            <%:item.MoTa%>
        </td>
        <td style="border: medium outset;"align=center>
            <%:Html.ActionLink("Sửa", "SuaLoaiCN", "Ad_ChungNhan", new { id = item.ID }, new { @class = "al-edit", @title = "Sửa" })%>
            <%:Html.ActionLink("Xóa", "XoaLoaiCN", "Ad_ChungNhan", new { id = item.ID }, new { @class = "al-delete", @title = "Xóa" })%>
        </td>
    </tr>
    <%  
        }
          } %>
</table>
<%} %>
